//服务层
const {
	updateStatistics3,
	getTodayStatistics3,
	getTotalStatistics3,
	getListStatistics3
} = require("../dao/totalStatisticsDao");
/*
引入
const {updateStatistics} = require('./totalStatisticsService');
调用:key为要自增的属性 类型 String (admins,users,orders)
updateStatistics(key);
*/
module.exports.updateStatistics = async key => {
	const data = await updateStatistics3(key);
	if (data.ok == 1) {
		return true;
	} else {
		return false;
	}
};
module.exports.getStatistics2 = async type => {
	let data;
	if (type == "today") {
		data = await getTodayStatistics3();
	} else if (type == "total") {
		data = await getTotalStatistics3();
	} else if (type == "list") {
		data = await getListStatistics3();
	}
	console.log(data);
	return data;
};
